#!/bin/sh

TEMP_FILE=$(mktemp -p ${PWD} plotter.XXXXXXXXXX) && {
    
    ./test-parametric ${@} > ${TEMP_FILE}
    
    gnuplot <<_EOF
set terminal jpeg
set output "${TEMP_FILE}.jpeg"
set title "Parametric Signal"
set zero 1e-11
set yrange [0:2750]
plot [-200:200] "${TEMP_FILE}" using 1:2 title "Clean Signal" lt rgb "blue" with l, "${TEMP_FILE}" using 1:3 title "Noisy Signal" lt rgb "orange" with l
_EOF

    rm -f "${TEMP_FILE}"
}
